#ifndef __THREADPOOL_H__
#define __THREADPOOL_H__

#include "taskQueue.h"
#include "train.h"

typedef struct threadPool_s{
    pthread_t *tidArr;
    int threadnum;
    taskQueue_t taskQueue;
    int exitFlag;
    train_t train;
}threadPool_t;

int threadPoolInit(threadPool_t *threadPool, int workernum);
int makeWorker(threadPool_t *threadPool);
int tcpInit(const char *ip, const char *port, int *psockfd);
int epollAdd(int epfd, int fd);
int epollDel(int epfd, int fd);
int transFile(int netfd);
int workerExecute(train_t* train);
int shortCommandEvent(train_t* train, int netfd);
#endif
